/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.BillClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import com.enation.app.javashop.model.orderbill.dos.BillItem;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author fk
 * @version v2.0
 * @Description: 结算单对外client断路器
 * @date 2018/9/27 14:33
 * @since v7.0.0
 */
@Component
public class BillClientFallbackFactory extends BaseFallbackFactory<BillClientFeignImpl> implements FallbackFactory {


    @Override
    protected BillClientFeignImpl fallback() {
        return new BillClientFallback();
    }

    /**
     * @author fk
     * @version v2.0
     * @Description: 结算单对外client断路器
     * @date 2018/9/27 14:33
     * @since v7.0.0
     */
    @Component
    public static class BillClientFallback implements BillClientFeignImpl {

        protected final Log logger = LogFactory.getLog(this.getClass());

        @Override
        public void createBills(Long startTime, Long endTime) {

            this.logger.error("交易服务异常，创建结算单异常");

        }

        @Override
        public BillItem add(BillItem billItem) {

            this.logger.error("交易服务异常，添加结算项异常");

            return null;
        }
    }
}
